<?php

class ErrorController {

    function __construct() {
        
    }

    public function cadastrar() {
        try {
            
        } catch (Exception $e) {
            echo "Exception: " . $e->getMessage();
        }
    }

    public function listar() {
        try {
            
        } catch (Exception $e) {
            echo "Exception: " . $e->getMessage();
        }
    }
}

$controller = new ErrorController();
if ($_POST['acao'] == 'cadastrar') {
    $controller->cadastrar();
} elseif ($_POST['acao'] == 'listar') {
    $controller->listar();
}
?>
